package com.jd.ymcc.exception;

import com.jd.ymcc.enums.GlobalErrorCode;
import lombok.Data;

@Data
public class GlobalCustomException extends RuntimeException{
    private String errorMsg;
    private String errorCode;

    public GlobalCustomException(){
        super();
    }

    public GlobalCustomException(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public GlobalCustomException(String errorMsg, String errorCode) {
        super(errorMsg);
        this.errorMsg = errorMsg;
        this.errorCode = errorCode;
    }

    public GlobalCustomException(GlobalErrorCode globalErrorCode) {
        super(globalErrorCode.getMessage());
        this.errorMsg = errorMsg;
        this.errorCode = errorCode;
    }
}
